home *** CD-ROM | disk | FTP | other *** search
- Subject: Re: Error in ODFDraw (was Re: Unknown Error in OpenDoc or
- Sent: 9/13/96 2:11 PM
- Received: 9/13/96 2:11 PM
- From: Troy Gaul <tgaul@apple.com>
- Reply-To: ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List
-
-
- >OK, after installing the debug version of ODFLib I get the errors, and I
- >tracked down the bug to an aborted drag causing the problem. I can
- >recreate it using ODFDraw (rev 1).
- >
- >here are the steps:
- >1. open a new ODFDraw doc.
- >2. create a simple shape.
- >3. drag the shape, but have the drag aborted (let it go in the menu bar
- >for example).
- >4. Close the document
- >
- >you then get the debug string:
- >FW_CFixedAllocator: An object of type FW_CPriv{BW|Color}PatternRep has
- >not been deleted prop
- >
- >which results in the Unknown OpenDoc error.
- >
- >What's up with that?
-
- It's an exception-handling mistake in ODF 1. It's been fixed in ODF 2.
- Here's the message Henri sent to me at the time (sorry for the wrapping):
-
- ---------- cut here ----------
-
- I found the drag refcount problem here is the method to replace
-
- //------------------------------------------------------------------------------
- ----------
- // FW_MDraggableFrame::Drag
- //------------------------------------------------------------------------------
- ----------
-
- FW_Boolean FW_MDraggableFrame::Drag(Environment *ev, const FW_CMouseEvent&
- theMouseEvent)
- {
- if (!theMouseEvent.WaitUntilMouseMoved(ev))
- return FALSE;
-
- #ifdef FW_DEBUG
- FW_CFrame *frame = FW_CFrame::ODtoFWFrame(ev,
- theMouseEvent.GetFacet(ev)->GetFrame(ev));
- FW_ASSERT(frame == fFrame);
- #endif
-
- FW_CDragCommand* dragCommand = this->NewDragCommand(ev, fFrame,
- theMouseEvent);
- if (dragCommand)
- {
- FW_CPresentation* presentation = fFrame->GetPresentation(ev);
- presentation->PrivSetDragPending(TRUE);
-
- short level = 0; // Added
- FW_VOLATILE(level); // Added
-
- FW_TRY
- {
- dragCommand->BeginDrag(ev, theMouseEvent);
- level = 1; // Added
- dragCommand->Execute(ev);
- }
- FW_CATCH_BEGIN
- FW_CATCH_EVERYTHING()
- {
- if (level == 0) // throw in BeginDrag
- // Added
- delete dragCommand;
- // Added
-
- presentation->PrivSetDragPending(FALSE);
-
- FW_THROW_SAME();
- }
- FW_CATCH_END
-
- presentation->PrivSetDragPending(FALSE);
-
- return TRUE;
- }
-
- return FALSE;
- }
-
-
- ........................................................................
- Henri Lamiraux lamiraux@apple.com
- Apple Computer, Inc. OpenDoc(tm) Development Framework
- ........................................................................
-
- ---------- cut here ----------
-
- I incorporated this into my version of ODF 1 without incident.
-
- _troy
-
- ......................................................................
- Troy Gaul tgaul@apple.com
- Apple Computer, Inc. OpenDoc Parts